﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SharingCenter.Web.Mod.Learning
{
    using SharingCenter.Web.Classes;
    using SharingCenter.Web.Classes.enums;
    public partial class MyProfile : LearningPageBase
    {
        protected void Page_Init(object sender, EventArgs e)
        {
            LinqDataSource1.Selected += new EventHandler<LinqDataSourceStatusEventArgs>(LinqDataSource1_Selected);
        }

        void LinqDataSource1_Selected(object sender, LinqDataSourceStatusEventArgs e)
        {
            HyperLink1.Visible = e.TotalRowCount < 3;
        }

        void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            //ListView lvInput = (ListView)e.Item.FindControl("lvIoInput");
            //ListView lvOutput = (ListView)e.Item.FindControl("lvIoOutput");
            //lvInput.DataSource = from t in ((Sc_LearningProfile)((ListViewDataItem)e.Item).DataItem).Sc_LearningIOs
            //                     where t.Direction == LearningSkillDirection.Input
            //                     select t;
            //lvOutput.DataSource = from t in ((Sc_LearningProfile)((ListViewDataItem)e.Item).DataItem).Sc_LearningIOs
            //                     where t.Direction == LearningSkillDirection.Output
            //                     select t;
            //lvInput.DataBind();
            //lvOutput.DataBind();
        }



        protected void LearningProfileItem_ItemDeleted(object sender, EventArgs e)
        {
            this.SetTopMostMessage("互助信息已删除。", true);
            RefreshPage(true);
        }
    }
}
